<?php
defined('IN_DESTOON') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form method="post" action="?" id="dform" onsubmit="return check();">
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
<input type="hidden" name="file" value="<?php echo $file;?>"/>
<input type="hidden" name="action" value="<?php echo $action;?>"/>
<input type="hidden" name="catid" value="<?php echo $catid;?>"/>
<input type="hidden" name="id" value="<?php echo $id;?>"/>
<input type="hidden" name="forward" value="<?php echo $forward;?>"/>
<div class="tt"><?php echo $action=='add' ? '添加' : '修改';?>属性</div>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 属性名称</td>
<td><span class="f_red">*</span> 属性名称列表值（对应分类勾选即可）</td>
</tr>
<?php foreach($datalist as $k=>$v) { 
if($v['pid']==0){
?>
<tr>
<td class="tl">
<input type="radio" name="pid[<?=$v['id']?>]" value="<?=$v['id']?>" <?php if($v['id'] == $ids[$k]['cid']){?>checked<?php }?>/><?=$v['name']?>
<input type="hidden" name="pid[<?=$v['id']?>][tb]" value="<?=$v['tb']?>" />
<input type="hidden" name="pid[<?=$v['id']?>][cid]" value="<?=$v['id']?>" />
</td>
<td>
<?php
foreach($datalist as $k1=>$v1) { 
if($v1['pid']==$v['id']){
?>
<input type="checkbox" name="pid[<?=$v['id']?>][sid][<?=$v1['id']?>]" value="<?php echo $k1;?>" <?php if($k1 == $ids[$v['id']]['sid'][$v1['id']]){?>checked<?php }?>/><label style="width:100px;"><?php echo $v1['name'];?></label>
<?php } }?></td>
</tr>
<?php }}?>
</table>
<div class="sbt"><input type="submit" name="submit" value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value=" 关 闭 " class="btn" onclick="window.parent.location.reload();;"/></div>
</form>
<script type="text/javascript">Menuon(<?php echo $action=='add' ? 0 : 1;?>);</script>
<?php include tpl('footer');?>